package ATBMS.modles.DAO;

import ATBMS.modles.Ticket;
import java.util.List;

/**
 * Ticket DAO Interface
 */
public interface TicketDAO {

    /**
     * put a Ticket Object into database
     * @param ticket
     * @return succeed or failed
     */
    public boolean insert(Ticket ticket);

    /**
     * Update a Ticket Object
     * @param tid
     * @param ticket
     */
    public void update(int tid, Ticket ticket);

    /**
     * Update User's Telephone Number By UID
     * @param uid
     * @param newTelphoneNumber
     */
    public void updateUsersTelphone(int uid, String newTelphoneNumber);

    /**
     * Delete A Ticket From database By tickect id
     * @param tid
     */
    public void delete(int tid);

    /**
     * Retrieve Tickets By User id
     * @param uid
     * @return Tickect List
     */
    public List<Ticket> findByUserID(int uid);

    /**
     * Retrieve Tickets By Telephone Number
     * @param tel
     * @return Tickect List
     */
    public List<Ticket> findByTel(String tel);

    /**
     * Get Error Message
     * @return
     */
    public String getErrorMessage();
}
